import request from "@/utils/request"

// 业绩指标设置-列表
export function queryPerformanceIndicatorList(data) {
  return request({
    url: "/base/performance-indicator/index",
    method: "post",
    data,
  })
}

// 业绩指标设置-新增
export function createPerformanceIndicator(data) {
  return request({
    url: "/base/performance-indicator/create",
    method: "post",
    data,
  })
}

// 业绩指标设置-编辑
export function updatePerformanceIndicator(data) {
  return request({
    url: "/base/performance-indicator/update",
    method: "post",
    data,
  })
}

//业绩指标设置-批量更新
export function batchUpdatePerformanceIndicator(data) {
  return request({
    url: "/base/performance-indicator/batch-update",
    method: "post",
    data,
  })
}

// 业绩指标设置-日志表
export function getLog(params) {
  return request({
    url: "/oplog/base.performance-indicator",
    method: "GET",
    params,
  })
}

// 业绩指标设置-详情
export function getPerformanceIndicatorDetail(params) {
  return request({
    url: "/base/performance-indicator/detail",
    method: "GET",
    params,
  })
}

// 业绩指标设置-删除
export function deletePerformanceIndicator(data) {
  return request({
    url: "/base/performance-indicator/delete",
    method: "POST",
    data,
  })
}

// 业绩指标设置-完成情况
export function getFinsh(params) {
  return request({
    url: "/base/performance-indicator/finish",
    method: "GET",
    params,
  })
}
// 业绩达成报表 导入
export function deletePerformanceIndicatorImport(data) {
  return request({
    url: "/base/performance-indicator/import",
    method: "POST",
    data,
  })
}

// 业绩达成报表 指标列表 new
export function kpiIndex(data) {
  return request({
    url: "/base/kpi/index",
    method: "POST",
    data,
  })
}
// 业绩达成报表 新增指标 new
export function baseKpi(id) {
  return request({
    url: `/base/kpi/${id}`,
    method: "GET",
    // params,
  })
}
// 业绩达成报表 新增指标 new
export function kpiCreate(data) {
  return request({
    url: "/base/kpi/create",
    method: "POST",
    data,
  })
}
// 业绩达成报表 修改指标 new
export function kpiEdit(data) {
  return request({
    url: `/base/kpi/${data?.id}/edit`,
    method: "POST",
    data,
  })
}

// 业绩达成报表 启用禁用 new
export function kpiStatus(data) {
  return request({
    url: "/base/kpi/status",
    method: "POST",
    data,
  })
}

// 业绩达成报表 删除指标 new
export function kpiDel(data) {
  return request({
    url: `/base/kpi/${data?.id}/del`,
    method: "POST",
    data,
  })
}

// 业绩达成报表 操作日志 new
export function kpiLog(params) {
  return request({
    url: "/log/business",
    method: "GET",
    params,
  })
}

// 业绩达成报表 完成情况 new
export function kpiFinish(data) {
  return request({
    url: `/base/kpi/${data?.id}/finish`,
    method: "POST",
    data,
  })
}
// 业绩达成报表 完成情况 new
export function kpiMember(params) {
  return request({
    url: `/base/kpi/${params?.id}/member`,
    method: "GET",
  })
}

// 业绩达成报表 导入指标 new
export function kpiImport(data) {
  return request({
    url: "/base/kpi/import",
    method: "POST",
    data,
  })
}

